/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author KNO
 */
@Entity
@Table(name = "beca")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Beca.findAll", query = "SELECT b FROM Beca b"),
    @NamedQuery(name = "Beca.findByBecaCodigo", query = "SELECT b FROM Beca b WHERE b.becaCodigo = :becaCodigo"),
    @NamedQuery(name = "Beca.findByBecaInicio", query = "SELECT b FROM Beca b WHERE b.becaInicio = :becaInicio"),
    @NamedQuery(name = "Beca.findByBecaVencimiento", query = "SELECT b FROM Beca b WHERE b.becaVencimiento = :becaVencimiento"),
    @NamedQuery(name = "Beca.findByBecaTipo", query = "SELECT b FROM Beca b WHERE b.becaTipo = :becaTipo"),
    @NamedQuery(name = "Beca.findByBecaPorcentaje", query = "SELECT b FROM Beca b WHERE b.becaPorcentaje = :becaPorcentaje")})
public class Beca implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "beca_codigo")
    private Integer becaCodigo;
    @Column(name = "beca_inicio")
    @Temporal(TemporalType.DATE)
    private Date becaInicio;
    @Column(name = "beca_vencimiento")
    @Temporal(TemporalType.DATE)
    private Date becaVencimiento;
    @Column(name = "beca_tipo")
    private Short becaTipo;
    @Column(name = "beca_porcentaje")
    private Integer becaPorcentaje;
    @OneToMany(mappedBy = "estCodbeca")
    private List<Estudiante> estudianteList;

    public Beca() {
    }

    public Beca(Integer becaCodigo) {
        this.becaCodigo = becaCodigo;
    }

    public Integer getBecaCodigo() {
        return becaCodigo;
    }

    public void setBecaCodigo(Integer becaCodigo) {
        this.becaCodigo = becaCodigo;
    }

    public Date getBecaInicio() {
        return becaInicio;
    }

    public void setBecaInicio(Date becaInicio) {
        this.becaInicio = becaInicio;
    }

    public Date getBecaVencimiento() {
        return becaVencimiento;
    }

    public void setBecaVencimiento(Date becaVencimiento) {
        this.becaVencimiento = becaVencimiento;
    }

    public Short getBecaTipo() {
        return becaTipo;
    }

    public void setBecaTipo(Short becaTipo) {
        this.becaTipo = becaTipo;
    }

    public Integer getBecaPorcentaje() {
        return becaPorcentaje;
    }

    public void setBecaPorcentaje(Integer becaPorcentaje) {
        this.becaPorcentaje = becaPorcentaje;
    }

    @XmlTransient
    public List<Estudiante> getEstudianteList() {
        return estudianteList;
    }

    public void setEstudianteList(List<Estudiante> estudianteList) {
        this.estudianteList = estudianteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (becaCodigo != null ? becaCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Beca)) {
            return false;
        }
        Beca other = (Beca) object;
        if ((this.becaCodigo == null && other.becaCodigo != null) || (this.becaCodigo != null && !this.becaCodigo.equals(other.becaCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Beca[ becaCodigo=" + becaCodigo + " ]";
    }
    
}
